package com.dstation.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dstation.domain.CollectionInfo;
import com.dstation.domain.VideoInfo;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

public interface CollectionInfoMapper extends BaseMapper<CollectionInfo> {

    int insertCollection(@Param("userId") Long userId, @Param("videoId")Long videoId, @Param("time")Timestamp time);

    int deleteCollection(@Param("userId") Long userId, @Param("videoId")Long videoId);

    IPage<VideoInfo> selectCollections(@Param("ipage") Page<VideoInfo> collectionInfoPage, @Param("userId") Long userId);

    List<CollectionInfo> selectHaveCollection(@Param("userId") Long userId, @Param("videoId") Long videoId);
}